package cn.iocoder.yudao.module.wms.dal.mysql.rdrecord10;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.wms.controller.admin.rdrecord01.vo.Rdrecord01SaveReqVO;
import cn.iocoder.yudao.module.wms.dal.dataobject.pomain.PomainDO;
import cn.iocoder.yudao.module.wms.dal.dataobject.rdrecord10.Rdrecord10DO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.wms.controller.admin.rdrecord10.vo.*;

/**
 * 生产入库主 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface Rdrecord10Mapper extends BaseMapperX<Rdrecord10DO> {

    default PageResult<Rdrecord10DO> selectPage(Rdrecord10PageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<Rdrecord10DO>()
                .likeIfPresent(Rdrecord10DO::getSerialNumber, reqVO.getSerialNumber())
                .eqIfPresent(Rdrecord10DO::getPersonId, reqVO.getPersonId())
                .eqIfPresent(Rdrecord10DO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(Rdrecord10DO::getWarehouseId, reqVO.getWarehouseId())
                .betweenIfPresent(Rdrecord10DO::getOrderDate, reqVO.getOrderDate())
                .likeIfPresent(Rdrecord10DO::getRemark, reqVO.getRemark())
                .betweenIfPresent(Rdrecord10DO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(Rdrecord10DO::getStatus, reqVO.getStatus())
                .orderByDesc(Rdrecord10DO::getId));
    }
    void updateRdrecord10Status(Rdrecord10SaveReqVO reqVO);

    Rdrecord10DO findByProcessInstanceId(String processInstanceId);
    int findCountByCode(String code);
    List<Rdrecords10RespVO> findRdrecords10ByPid(Integer pid);
    Rdrecords10RespVO findRdrecords10ById(Integer id);
}